

class WashMachine{
    //字段【属性】~成员变量
    public String brand;
    public String type;
    public double weight;
    public double length;
    public double width;
    public double height;

    //方法【行为】~成员方法
    public void WashClothes(){
        System.out.println("洗衣服");
    }
    public void DryClothes(){
        System.out.println("甩干");
    }
    public void SetTime(){
        System.out.println("定时");
    }
}

class Dog{
    public String name;
    public int age;
    public String color;
    public void Wag(){
        System.out.println(name+" 摇尾巴");
    }
    public void Eat(){
        System.out.println(name+" 吃饭");
    }
    public void Show(){
        System.out.println(" 姓名："+name+" 年龄："+age+" 颜色："+color);
    }
}



public class Test {

    public static void main(String[] args) {
        //通过new关键字实例化对象
        Dog dog = new Dog();
//        System.out.println(dog.name);
//        System.out.println(dog.age);
//        System.out.println(dog.color);
        dog.name = "初一";
        dog.age = 3;
        dog.color = "黑色";
        dog.Wag();
        dog.Eat();
        dog.Show();

        Dog dog1 = new Dog();
        //通过一个类可以创建多个对象
    }

}
